package com.dongdongshop.controller;

import com.dongdongshop.service.ItemPageService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "AUDIT",consumerGroup = "dongdongshopMq")
public class ItemPageController implements RocketMQListener<String> {

    @Autowired
    private ItemPageService itemPageService;

    @Override
    public void onMessage(String s) {
        Long id = Long.parseLong(s);
        itemPageService.item(id);
    }
}
